# Contributor: Curt Tilmes <Curt.Tilmes@nasa.gov>
# Maintainer: Curt Tilmes <Curt.Tilmes@nasa.gov>
pkgname=primesieve
pkgver=8.0
pkgrel=0
pkgdesc="Program and library for generating prime numbers"
url="http://primesieve.org"
arch="all"
license="BSD-2-Clause"
makedepends="
	cmake
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/kimwalisch/primesieve/archive/v$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DBUILD_TESTS=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
213785c89868f224091fe76a74b98a896c374a7a96e2bdb44b07f4c6288bd50e22d9a563382fb512e71a1ad366d8b94e74fcc8b5f58bb94c85b4d435fbb6a571  primesieve-8.0.tar.gz
"
